<template>
  <Layout hasBacktop>
    <div class="container">
      <Row :gutter="15">
        <Col span="6">
          <div class="subject_list">
            <div v-for="(subject,index) in subjects" :key="index" class="subject" :style="{backgroundColor: subject.color}" @click="$router.push('/subject/sdfsadfs')">
              <Icon size="16" :type="subject.icon"></Icon>
              <span class="title">{{subject.title}}</span>
            </div>
          </div>
        </Col>
        <Col span="17">
          <!-- <Carousel
            class="carousel"
            v-model="value"
            :autoplay="true"
            trigger="hover">
            <CarouselItem>
              <div class="carousel_item">1</div>
            </CarouselItem>
            <CarouselItem>
              <div class="carousel_item">2</div>
            </CarouselItem>
            <CarouselItem>
              <div class="carousel_item">3</div>
            </CarouselItem>
            <CarouselItem>
              <div class="carousel_item">4</div>
            </CarouselItem>
          </Carousel> -->
          <div class="article_list">
            <div v-for="(article, index) in articles" :key="index" class="article"></div>
          </div>
        </Col>
      </Row>
    </div>
  </Layout>
</template>

<script>
import Layout from '@/layout/Layout'

export default {
  components: { Layout },
  data () {
    return {
      // value: 0,
      subjects: [
        { title: '随心小文', icon: 'beer' },
        { title: '技术博客', icon: 'coffee' },
      ],
      articles: [
        { title: '随心小文', color: '#c79efe' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
        { title: '技术博客', color: '#b7d6ec' },
      ]
    }
  }
}
</script>

<style lang="less" scoped>
  .container{
    width: 960px;
    margin: 20px auto;
    .subject_list{
      padding: 20px 0 10px;
      background-color: #fff;
      .subject{
        margin-bottom: 5px;
        height: 40px;
        line-height: 40px;
        padding: 0 40px;
        transition: all 500ms;
        color: #555;
        .title{
          margin-left: 10px;
          font-size: 14px;
        }
      }
      .subject:hover{
        color: #222;
        cursor: pointer;
        background-color: #f5f5f5;
      }
    }
    // .subject_list.top{
    //   display: fixed;
    //   top: 100px;
    // }
    .carousel{
      margin-bottom: 10px;
      &_item{
        height: 250PX;
        background-color: #c79efe;
        color: #fff;
        line-height: 250px;
        text-align: center;
        font-size: 20px;
      }
    }
    .article_list{
      .article{
        margin-bottom: 10px;
        background-color: #fff;
        height: 200px;
      }
    }
  }
</style>
